Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Synchronization (computer science)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Synchronization_(computer_science)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Synchronization_computer_science rootpage-Synchronization_computer_science skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Synchronization (computer science)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">Not to be confused with <a href="Data_synchronization" title="Data synchronization">Data synchronization</a>.</div>
<p class="mw-empty-elt">
</p>
<style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */


.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style>
<p>In <a href="Computer_science" title="Computer science">computer science</a>, <b>synchronization</b> is the task of coordinating multiple <a href="Process_(computer_science)" class="mw-redirect" title="Process (computer science)">processes</a> to join up or <a href="Handshake_(computing)" title="Handshake (computing)">handshake</a> at a certain point, in order to reach an agreement or commit to a certain sequence of action.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Motivation">Motivation</h2></div>
<p>The need for synchronization does not arise merely in multi-processor systems but for any kind of concurrent processes; even in single processor systems. Mentioned below are some of the main needs for synchronization:
</p><p><i><a href="Fork%E2%80%93join_model" title="Fork–join model">Forks and Joins</a>:</i> When a job arrives at a fork point, it is split into N sub-jobs which are then serviced by n tasks. After being serviced, each sub-job waits until all other sub-jobs are done processing. Then, they are joined again and leave the system. Thus, parallel programming requires synchronization as all the parallel processes wait for several other processes to occur.
</p><p><i><a href="Producer%E2%80%93consumer_problem" title="Producer–consumer problem">Producer-Consumer:</a></i> In a producer-consumer relationship, the consumer process is dependent on the producer process until the necessary data has been produced.
</p><p><i>Exclusive use resources:</i> When multiple processes are dependent on a resource and they need to access it at the same time, the operating system needs to ensure that only one processor accesses it at a given point in time. This reduces concurrency.
</p>
<div class="mw-heading mw-heading2"><h2 id="Requirements">Requirements</h2></div>

<p>Thread synchronization is defined as a mechanism which ensures that two or more concurrent <a href="Process_(computer_science)" class="mw-redirect" title="Process (computer science)">processes</a> or <a href="Thread_(computer_science)" class="mw-redirect" title="Thread (computer science)">threads</a> do not simultaneously execute some particular program segment known as <a href="Critical_section" title="Critical section">critical section</a>. Processes' access to critical section is controlled by using synchronization techniques. When one thread starts executing the <a href="Critical_section" title="Critical section">critical section</a> (serialized segment of the program) the other thread should wait until the first thread finishes. If proper synchronization techniques<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> are not applied, it may cause a <a href="Race_condition#Software" title="Race condition">race condition</a> where the values of variables may be unpredictable and vary depending on the timings of <a href="Context_switch" title="Context switch">context switches</a> of the processes or threads.
</p><p>For example, suppose that there are three processes, namely 1, 2, and 3. All three of them are concurrently executing, and they need to share a common resource (critical section) as shown in Figure 1. Synchronization should be used here to avoid any conflicts for accessing this shared resource. Hence, when Process 1 and 2 both try to access that resource, it should be assigned to only one process at a time. If it is assigned to Process 1, the other process (Process 2) needs to wait until Process 1 frees that resource (as shown in Figure 2).
</p>

<p>Another synchronization requirement which needs to be considered is the order in which particular processes or threads should be executed. For example, one cannot board a plane before buying a ticket. Similarly, one cannot check e-mails before validating the appropriate credentials (for example, user name and password). In the same way, an ATM will not provide any service until it receives a correct PIN.
</p><p>Other than mutual exclusion, synchronization also deals with the following:
</p>
<ul><li><a href="Deadlock_(computer_science)" title="Deadlock (computer science)">deadlock</a>, which occurs when many processes are waiting for a shared resource (critical section) which is being held by some other process. In this case, the processes just keep waiting and execute no further;</li>
<li><a href="Resource_starvation" class="mw-redirect" title="Resource starvation">starvation</a>, which occurs when a process is waiting to enter the critical section, but other processes monopolize the critical section, and the first process is forced to wait indefinitely;</li>
<li><a href="Priority_inversion" title="Priority inversion">priority inversion</a>, which occurs when a high-priority process is in the critical section, and it is interrupted by a medium-priority process. This violation of priority rules can happen under certain circumstances and may lead to serious consequences in real-time systems;</li>
<li><a href="Busy_waiting" title="Busy waiting">busy waiting</a>, which occurs when a process frequently polls to determine if it has access to a critical section. This frequent polling robs processing time from other processes.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Minimization">Minimization</h2></div>
<p>One of the challenges for exascale algorithm design is to minimize or reduce synchronization.
Synchronization takes more time than computation, especially in distributed computing. Reducing synchronization drew attention from computer scientists for decades. Whereas it becomes an increasingly significant problem recently as the gap between the improvement of computing and latency increases. Experiments have shown that (global) communications due to synchronization on distributed computers takes a dominated share in a sparse iterative solver.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> This problem is receiving increasing attention after the emergence of a new benchmark metric, the High Performance Conjugate Gradient(HPCG),<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> for ranking the top 500 supercomputers.
</p>
<div class="mw-heading mw-heading2"><h2 id="Problems">Problems</h2></div>
<p>The following are some classic problems of synchronization:
</p>
<ul><li><a href="Producer%E2%80%93consumer_problem" title="Producer–consumer problem">The Producer–Consumer Problem</a> (also called The Bounded Buffer Problem);</li>
<li><a href="Readers%E2%80%93writers_problem" title="Readers–writers problem">The Readers–Writers Problem</a>;</li>
<li><a href="Dining_philosophers_problem" title="Dining philosophers problem">The Dining Philosophers Problem</a>.</li></ul>
<p>These problems are used to test nearly every newly proposed synchronization scheme or primitive.
</p>
<div class="mw-heading mw-heading3"><h3 id="Overhead">Overhead</h3></div>
<p>Synchronization overheads can significantly impact performance in <a href="Parallel_computing" title="Parallel computing">parallel computing</a> environments, where merging data from multiple processes can incur costs substantially higher—often by two or more orders of magnitude—than processing the same data on a single thread, primarily due to the additional overhead of <a href="Inter-process_communication" title="Inter-process communication">inter-process communication</a> and synchronization mechanisms. <sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Hardware_synchronization">Hardware synchronization</h2></div>
<p>Many systems provide hardware support for <a href="Critical_section" title="Critical section">critical section</a> code.
</p><p>A single processor or <a href="Uniprocessor_system" title="Uniprocessor system">uniprocessor system</a> could disable <a href="Interrupt" title="Interrupt">interrupts</a> by executing currently running code without <a href="Preemption_(computing)" title="Preemption (computing)">preemption</a>, which is very inefficient on <a href="Multiprocessing" title="Multiprocessing">multiprocessor</a> systems.<sup id="cite_ref-Wiley2014_7-0" class="reference"><a href="#cite_note-Wiley2014-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
"The key ability we require to implement synchronization in a multiprocessor is a set of hardware primitives with the ability to atomically read and modify a memory location. Without such a capability, the cost of building basic synchronization primitives will be too high and will increase as the processor count increases. There are a number of alternative formulations of the basic hardware primitives, all of which provide the ability to atomically read and modify a location, together with some way to tell if the read and write were performed atomically. These hardware primitives are the basic building blocks that are used to build a wide variety of user-level synchronization operations, including things such as <a href="Lock_(computer_science)" title="Lock (computer science)">locks</a> and <a href="Barrier_(computer_science)" title="Barrier (computer science)">barriers</a>. In general, architects do not expect users to employ the basic hardware primitives, but instead expect that the primitives will be used by system programmers to build a synchronization library, a process that is often complex and tricky."<sup id="cite_ref-Morgan2011_8-0" class="reference"><a href="#cite_note-Morgan2011-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> Many modern pieces of hardware provide such atomic instructions, two common examples being: <a href="Test-and-set" title="Test-and-set">test-and-set</a>, which operates on a single memory word, and <a href="Compare-and-swap" title="Compare-and-swap">compare-and-swap</a>, which swaps the contents of two memory words.
</p>
<div class="mw-heading mw-heading2"><h2 id="Support_in_programming_languages">Support in programming languages</h2></div>
<p>In <a href="Java_(programming_language)" title="Java (programming language)">Java</a>, one way to prevent thread interference and memory consistency errors, is by prefixing a method signature with the <i>synchronized</i> keyword, in which case the lock of the declaring object is used to enforce synchronization. A second way is to wrap a block of code in a <i>synchronized(someObject){...}</i> section, which offers finer-grain control. This forces any thread to acquire the lock of <i>someObject</i> before it can execute the contained block. The lock is automatically released when the thread which acquired the lock leaves this block or enters a waiting state within the block. Any variable updates made by a thread in a synchronized block become visible to other threads when they similarly acquire the lock and execute the block. For either implementation, any object may be used to provide a lock because all Java objects have an <i>intrinsic lock</i> or <i>monitor lock</i> associated with them when instantiated.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>
</p><p>Java <i>synchronized</i> blocks, in addition to enabling mutual exclusion and memory consistency, enable signaling—i.e. sending events from threads which have acquired the lock and are executing the code block to those which are waiting for the lock within the block. Java <i>synchronized</i> sections, therefore, combine the functionality of both <a href="Lock_(computer_science)" title="Lock (computer science)">mutexes</a> and <a href="Event_(synchronization_primitive)" class="mw-redirect" title="Event (synchronization primitive)">events</a> to ensure synchronization. Such a construct is known as a <a href="Monitor_(synchronization)" title="Monitor (synchronization)">synchronization monitor</a>.
</p><p>The <a href=".NET_Framework" title=".NET Framework">.NET Framework</a> also uses synchronization primitives.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> "Synchronization is designed to be cooperative, demanding that every thread follow the synchronization mechanism before accessing protected resources for consistent results. Locking, signaling, lightweight synchronization types, spinwait and interlocked operations are mechanisms related to synchronization in .NET."<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup>
</p><p>Many programming languages support synchronization and entire specialized <a href="Synchronous_programming_language" title="Synchronous programming language">languages</a> have been written for <a href="Embedded_software" title="Embedded software">embedded application</a> development where strictly deterministic synchronization is paramount.
</p>
<div class="mw-heading mw-heading2"><h2 id="Implementation">Implementation</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Spinlocks">Spinlocks</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Spinlock" title="Spinlock">Spinlock</a></div>
<p>Another effective way of implementing synchronization is by using spinlocks. Before accessing any shared resource or piece of code, every processor checks a flag. If the flag is reset, then the processor sets the flag and continues executing the thread. But, if the flag is set (locked), the threads would keep spinning in a loop and keep checking if the flag is set or not. Spinlocks are effective only if the flag is reset for lower cycles; otherwise, it can lead to performance issues as it wastes many processor cycles waiting.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Barriers">Barriers</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Barrier_(computer_science)" title="Barrier (computer science)">Barrier (computer science)</a></div>
<p>Barriers are simple to implement and provide good responsiveness. They are based on the concept of implementing wait cycles to provide synchronization. Consider three threads running simultaneously, starting from barrier 1. After time t, thread1 reaches barrier 2 but it still has to wait for thread 2 and 3 to reach barrier2 as it does not have the correct data. Once all the threads reach barrier 2 they all start again. After time t, thread 1 reaches barrier3 but it will have to wait for threads 2 and 3 and the correct data again.
</p><p>Thus, in barrier synchronization of multiple threads there will always be a few threads that will end up waiting for other threads as in the above example thread 1 keeps waiting for thread 2 and 3. This results in severe degradation of the process performance.<sup id="cite_ref-:0_13-0" class="reference"><a href="#cite_note-:0-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p><p>The barrier synchronization wait function for i<sup>th</sup> thread can be represented as:
</p><p>(Wbarrier)i=f ((Tbarrier)i, (Rthread)i)
</p><p>Where Wbarrier is the wait time for a thread, Tbarrier is the number of threads has arrived, and Rthread is the arrival rate of threads.<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup>
</p><p>Experiments show that 34% of the total execution time is spent in waiting for other slower threads.<sup id="cite_ref-:0_13-1" class="reference"><a href="#cite_note-:0-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Semaphores">Semaphores</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Semaphore_(programming)" title="Semaphore (programming)">Semaphore (programming)</a></div>
<p>Semaphores are signalling mechanisms which can allow one or more threads/processors to access a section. A Semaphore has a flag which has a certain fixed value associated with it and each time a thread wishes to access the section, it decrements the flag. Similarly, when the thread leaves the section, the flag is incremented. If the flag is zero, the thread cannot access the section and gets blocked if it chooses to wait.
</p><p>Some semaphores would allow only one thread or process in the code section. Such Semaphores are called binary semaphore and are very similar to Mutex. Here, if the value of semaphore is 1, the thread is allowed to access and if the value is 0, the access is denied.<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Distributed_transaction">Distributed transaction</h2></div>
<p>In <a href="Event-driven_architecture" title="Event-driven architecture">event driven architectures</a>, synchronous transactions can be achieved through using <a href="Request%E2%80%93response" title="Request–response">request-response</a> paradigm and it can be implemented in two ways: <sup id="cite_ref-:02_16-0" class="reference"><a href="#cite_note-:02-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li>Creating two separate <a href="Message_queue" title="Message queue">queues</a>: one for requests and the other for replies. The event producer must wait until it receives the response.</li>
<li>Creating one dedicated ephemeral <a href="Message_queue" title="Message queue">queue</a> for each request.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Mathematical_foundations">Mathematical foundations</h2></div>
<p>Synchronization was originally a process-based concept whereby a lock could be obtained on an object. Its primary usage was in databases. There are two types of (file) <a href="File_locking" title="File locking">lock</a>; read-only and read–write. Read-only locks may be obtained by many processes or threads. Readers–writer locks are exclusive, as they may only be used by a single process/thread at a time.
</p><p>Although locks were derived for file databases, data is also shared in memory between processes and threads. Sometimes more than one object (or file) is locked at a time. If they are not locked simultaneously they can overlap, causing a deadlock exception.
</p><p><a href="Java_(programming_language)" title="Java (programming language)">Java</a> and <a href="Ada_(programming_language)" title="Ada (programming language)">Ada</a> only have exclusive locks because they are thread based and rely on the <a href="Compare-and-swap" title="Compare-and-swap">compare-and-swap</a> processor instruction.
</p><p>An abstract mathematical foundation for synchronization primitives is given by the <a href="History_monoid" title="History monoid">history monoid</a>. There are also many higher-level theoretical devices, such as <a href="Process_calculi" class="mw-redirect" title="Process calculi">process calculi</a> and <a href="Petri_net" title="Petri net">Petri nets</a>, which can be built on top of the history monoid.
</p>
<div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2></div>
<p>Following are some synchronization examples with respect to different platforms.<sup id="cite_ref-Wiley2012_17-0" class="reference"><a href="#cite_note-Wiley2012-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="In_Windows">In Windows</h3></div>
<p><a href="Windows" class="mw-redirect" title="Windows">Windows</a> provides:
</p>
<ul><li><a href="Interrupt" title="Interrupt">interrupt masks</a>, which protect access to global resources (critical section) on uniprocessor systems;</li>
<li><a href="Spinlock" title="Spinlock">spinlocks</a>, which prevent, in multiprocessor systems, spinlocking-thread from being preempted;</li>
<li><a href="Dynamic_dispatch" title="Dynamic dispatch">dynamic dispatchers</a>, which act like <a href="Mutual_exclusion" title="Mutual exclusion">mutexes</a>, <a href="Semaphore_(programming)" title="Semaphore (programming)">semaphores</a>, <a href="Event_(computing)" title="Event (computing)">events</a>, and <a href="Timer" title="Timer">timers</a>.</li></ul>
<div class="mw-heading mw-heading3"><h3 id="In_Linux">In Linux</h3></div>
<p><a href="Linux" title="Linux">Linux</a> provides:
</p>
<ul><li><a href="Semaphore_(programming)" title="Semaphore (programming)">semaphores</a>;</li>
<li><a href="Spinlock" title="Spinlock">spinlock</a>;</li>
<li><a href="Barrier_(computer_science)" title="Barrier (computer science)">barriers</a>;</li>
<li><a href="Mutual_exclusion" title="Mutual exclusion">mutex</a>;</li>
<li><a href="Readers%E2%80%93writer_lock" title="Readers–writer lock">readers–writer locks</a>, for the longer section of codes which are accessed very frequently but don't change very often;</li>
<li><a href="Read-copy-update" title="Read-copy-update">read-copy-update</a> (RCU).<sup id="cite_ref-18" class="reference"><a href="#cite_note-18"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup></li></ul>
<p>Enabling and disabling of kernel preemption replaced spinlocks on uniprocessor systems. Prior to kernel version 2.6, <a href="Linux" title="Linux">Linux</a> disabled interrupt to implement short critical sections. Since version 2.6 and later, Linux is fully preemptive.
</p>
<div class="mw-heading mw-heading3"><h3 id="In_Solaris">In Solaris</h3></div>
<p><a href="Solaris_(operating_system)" class="mw-redirect" title="Solaris (operating system)">Solaris</a> provides:
</p>
<ul><li><a href="Semaphore_(programming)" title="Semaphore (programming)">semaphores</a></li>
<li><a href="Condition_variable" class="mw-redirect" title="Condition variable">condition variables</a></li>
<li>adaptive <a href="Lock_(computer_science)" title="Lock (computer science)">mutexes</a> – binary semaphores that are implemented differently depending upon the conditions<sup id="cite_ref-19" class="reference"><a href="#cite_note-19"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup></li>
<li>readers-writer locks</li>
<li><a href="Turnstiles" class="mw-redirect" title="Turnstiles">turnstiles</a> – queue of threads which are waiting on acquired lock<sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup></li></ul>
<div class="mw-heading mw-heading3"><h3 id="In_Pthreads">In Pthreads</h3></div>
<p><a href="Pthreads" title="Pthreads">Pthreads</a> is a platform-independent <a href="API" title="API">API</a> that provides:
</p>
<ul><li>mutexes;</li>
<li>condition variables;</li>
<li>readers–writer locks;</li>
<li>spinlocks;</li>
<li><a href="Barrier_(computer_science)" title="Barrier (computer science)">barriers</a>.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Futures_and_promises" title="Futures and promises">Futures and promises</a>, synchronization mechanisms in pure functional paradigms</li>
<li><a href="Memory_barrier" title="Memory barrier">Memory barrier</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFGramoli,_V.2015" class="citation conference cs1">Gramoli, V. (2015). <a rel="nofollow" class="external text" href="http://sydney.edu.au/engineering/it/~gramoli/doc/pubs/gramoli-synchrobench.pdf"><i>More than you ever wanted to know about synchronization: Synchrobench, measuring the impact of the synchronization on concurrent algorithms</i></a> <span class="cs1-format">(PDF)</span>. Proceedings of the 20th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. ACM. pp.&nbsp;<span class="nowrap">1–</span>10.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFShengxin,_Zhu_and_Tongxiang_Gu_and_Xingping_Liu2014" class="citation journal cs1">Shengxin, Zhu and Tongxiang Gu and Xingping Liu (2014). <a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fj.camwa.2013.11.008">"Minimizing synchronizations in sparse iterative solvers for distributed supercomputers"</a>. <i>Computers &amp; Mathematics with Applications</i>. <b>67</b> (1): <span class="nowrap">199–</span>209. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fj.camwa.2013.11.008">10.1016/j.camwa.2013.11.008</a></span>. <a href="Hdl_(identifier)" class="mw-redirect" title="Hdl (identifier)">hdl</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://hdl.handle.net/10754%2F668399">10754/668399</a></span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://hpcg-benchmark.org/">"HPCG Benchmark"</a>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFSilberschatzGalvinGagne2008" class="citation book cs1">Silberschatz, Abraham; Galvin, Peter B.; Gagne, Greg (29 July 2008). <i>Operating System Concepts</i>. Wiley. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0470128725</bdi>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite class="citation book cs1"><i>Computer Organization and Design MIPS Edition: The Hardware/Software Interface (The Morgan Kaufmann Series in Computer Architecture and Design)</i>. Morgan Kaufmann. 2013. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0124077263</bdi>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite class="citation book cs1"><i>Parallel Programming: Techniques and Applications Using Networked Workstations and Parallel Computers</i>. Pearson. 2005. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0131405639</bdi>.</cite></span>
</li>
<li id="cite_note-Wiley2014-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-Wiley2014_7-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFSilberschatzGagneGalvin2008" class="citation book cs1">Silberschatz, Abraham; Gagne, Greg; Galvin, Peter Baer (July 11, 2008). "Chapter 6: Process Synchronization". <i>Operating System Concepts</i> (Eighth&nbsp;ed.). John Wiley &amp; Sons. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-470-12872-5</bdi>.</cite></span>
</li>
<li id="cite_note-Morgan2011-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-Morgan2011_8-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFHennessyPatterson2011" class="citation book cs1">Hennessy, John L.; Patterson, David A. (September 30, 2011). "Chapter 5: Thread-Level Parallelism". <i>Computer Architecture: A Quantitative Approach</i> (Fifth&nbsp;ed.). Morgan Kaufmann. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-123-83872-8</bdi>.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.oracle.com/javase/tutorial/essential/concurrency/locksync.html">"Intrinsic Locks and Synchronization"</a>. <i>The Java Tutorials</i>. Oracle<span class="reference-accessdate">. Retrieved <span class="nowrap">10 November</span> 2023</span>.</cite></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://learn.microsoft.com/en-us/dotnet/standard/threading/overview-of-synchronization-primitives">"Overview of synchronization primitives"</a>. <i>Microsoft Learn</i>. Microsoft. September 2022<span class="reference-accessdate">. Retrieved <span class="nowrap">10 November</span> 2023</span>.</cite></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><cite id="CITEREFRouse2011" class="citation web cs1">Rouse, Margaret (19 August 2011). <a rel="nofollow" class="external text" href="https://www.techopedia.com/definition/13390/synchronization-dot-net">"Synchronization"</a>. <i>Techopedia</i><span class="reference-accessdate">. Retrieved <span class="nowrap">10 November</span> 2023</span>.</cite></span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><cite id="CITEREFMassa2003" class="citation book cs1">Massa, Anthony (2003). <i>Embedded Software Development with ECos</i>. Pearson Education Inc. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-13-035473-2</bdi>.</cite></span>
</li>
<li id="cite_note-:0-13"><span class="mw-cite-backlink">^ <a href="#cite_ref-:0_13-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:0_13-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFMengChenPanYao2014" class="citation book cs1">Meng, Jinglei; Chen, Tianzhou; Pan, Ping; Yao, Jun; Wu, Minghui (2014). "A Speculative Mechanism for Barrier Synchronization". <i>2014 IEEE Intl Conf on High Performance Computing and Communications, 2014 IEEE 6th Intl Symp on Cyberspace Safety and Security, 2014 IEEE 11th Intl Conf on Embedded Software and Syst (HPCC,CSS,ICESS)</i>. pp.&nbsp;<span class="nowrap">858–</span>865. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FHPCC.2014.148">10.1109/HPCC.2014.148</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-4799-6123-8</bdi>.</cite></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><cite id="CITEREFRahman2012" class="citation book cs1">Rahman, Mohammed Mahmudur (2012). "Process synchronization in multiprocessor and multi-core processor". <i>2012 International Conference on Informatics, Electronics &amp; Vision (ICIEV)</i>. pp.&nbsp;<span class="nowrap">554–</span>559. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FICIEV.2012.6317471">10.1109/ICIEV.2012.6317471</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-4673-1154-0</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:8134329">8134329</a>.</cite></span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text"><cite id="CITEREFLi,_Yao2003" class="citation book cs1">Li, Yao, Qing, Carolyn (2003). <i>Real-Time Concepts for Embedded Systems</i>. CMP Books. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1578201242</bdi>.</cite><span class="cs1-maint citation-comment"><code class="cs1-code">{{cite book}}</code>: CS1 maint: multiple names: authors list (link)</span></span>
</li>
<li id="cite_note-:02-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-:02_16-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFRichards2020" class="citation book cs1">Richards, Mark (2020). <i>Fundamentals of Software Architecture: An Engineering Approach</i>. O'Reilly Media. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1492043454</bdi>.</cite></span>
</li>
<li id="cite_note-Wiley2012-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-Wiley2012_17-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFSilberschatzGagneGalvin2012" class="citation book cs1">Silberschatz, Abraham; Gagne, Greg; Galvin, Peter Baer (December 7, 2012). "Chapter 5: Process Synchronization". <i>Operating System Concepts</i> (Ninth&nbsp;ed.). John Wiley &amp; Sons. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-118-06333-0</bdi>.</cite></span>
</li>
<li id="cite_note-18"><span class="mw-cite-backlink"><b><a href="#cite_ref-18">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://lwn.net/Articles/262464/">"What is RCU, Fundamentally? [LWN.net]"</a>. <i>lwn.net</i>.</cite></span>
</li>
<li id="cite_note-19"><span class="mw-cite-backlink"><b><a href="#cite_ref-19">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.oracle.com/cd/E19253-01/817-6223/chp-lockstat-2/index.html">"Adaptive Lock Probes"</a>. <i>Oracle Docs</i>.</cite></span>
</li>
<li id="cite_note-20"><span class="mw-cite-backlink"><b><a href="#cite_ref-20">^</a></b></span> <span class="reference-text"><cite id="CITEREFMauro" class="citation web cs1">Mauro, Jim. <a rel="nofollow" class="external text" href="http://sunsite.uakom.sk/sunworldonline/swol-08-1999/swol-08-insidesolaris.html">"Turnstiles and priority inheritance - SunWorld - August 1999"</a>. <i>sunsite.uakom.sk</i>.</cite></span>
</li>
</ol></div></div>
<ul><li><cite id="CITEREFSchneider1997" class="citation book cs1">Schneider, Fred B. (1997). <i>On concurrent programming</i>. Springer-Verlag New York, Inc. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-387-94942-0</bdi>.</cite></li></ul>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20090209170415/http://ibm.com/developerworks/linux/library/l-linux-synchronization.html">Anatomy of Linux synchronization methods</a> at IBM developerWorks</li>
<li><a rel="nofollow" class="external text" href="http://greenteapress.com/semaphores/"><i>The Little Book of Semaphores</i></a>, by Allen B. Downey</li>
<li><a rel="nofollow" class="external text" href="https://www.encious.com/2019/02/introduction-to-process-synchronization.html">Need of Process Synchronization</a></li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}


/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="Concurrent_computing233" style="padding:3px"><table class="nowraplinks hlist mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div id="Concurrent_computing233" style="font-size:114%;margin:0 4em"><a href="Concurrent_computing" title="Concurrent computing">Concurrent computing</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">General</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Concurrency_(computer_science)" title="Concurrency (computer science)">Concurrency</a></li>
<li><a href="Concurrency_control" title="Concurrency control">Concurrency control</a></li>
<li><a href="Concurrent_data_structure" title="Concurrent data structure">Concurrent data structures</a>
<ul><li><a href="Concurrent_hash_table" title="Concurrent hash table">Concurrent hash tables</a></li></ul></li>
<li><a href="Concurrent_user" title="Concurrent user">Concurrent users</a></li>
<li><a href="Indeterminacy_in_concurrent_computation" title="Indeterminacy in concurrent computation">Indeterminacy</a></li>
<li><a href="Linearizability" title="Linearizability">Linearizability</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Process_calculus" title="Process calculus">Process calculi</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Communicating_sequential_processes" title="Communicating sequential processes">CSP</a></li>
<li><a href="Calculus_of_communicating_systems" title="Calculus of communicating systems">CCS</a></li>
<li><a href="Algebra_of_Communicating_Processes" class="mw-redirect" title="Algebra of Communicating Processes">ACP</a></li>
<li><a href="Language_Of_Temporal_Ordering_Specification" class="mw-redirect" title="Language Of Temporal Ordering Specification">LOTOS</a></li>
<li><a href="%CE%A0-calculus" title="Π-calculus">π-calculus</a></li>
<li><a href="Ambient_calculus" title="Ambient calculus">Ambient calculus</a></li>
<li><a href="API-Calculus" title="API-Calculus">API-Calculus</a></li>
<li><a href="PEPA" title="PEPA">PEPA</a></li>
<li><a href="Join-calculus" title="Join-calculus">Join-calculus</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Classic problems</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="ABA_problem" title="ABA problem">ABA problem</a></li>
<li><a href="Cigarette_smokers_problem" title="Cigarette smokers problem">Cigarette smokers problem</a></li>
<li><a href="Deadlock_(computer_science)" title="Deadlock (computer science)">Deadlock</a></li>
<li><a href="Dining_philosophers_problem" title="Dining philosophers problem">Dining philosophers problem</a></li>
<li><a href="Producer%E2%80%93consumer_problem" title="Producer–consumer problem">Producer–consumer problem</a></li>
<li><a href="Race_condition" title="Race condition">Race condition</a></li>
<li><a href="Readers%E2%80%93writers_problem" title="Readers–writers problem">Readers–writers problem</a></li>
<li><a href="Sleeping_barber_problem" title="Sleeping barber problem">Sleeping barber problem</a></li></ul>
</div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div>
<ul><li><span class="noviewer" typeof="mw:File"><span title="Category"></span></span>&nbsp;Category: Concurrent computing</li></ul>
</div></td></tr></tbody></table></div>
<div class="navbox-styles"></div><div role="navigation" class="navbox" aria-labelledby="Parallel_computing346" style="padding:3px"><table class="nowraplinks hlist mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><div id="Parallel_computing346" style="font-size:114%;margin:0 4em"><a href="Parallel_computing" title="Parallel computing">Parallel computing</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">General</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Distributed_computing" title="Distributed computing">Distributed computing</a></li>
<li><a href="Parallel_computing" title="Parallel computing">Parallel computing</a></li>
<li><a href="Parallel_algorithm" title="Parallel algorithm">Parallel algorithm</a></li>
<li><a href="Massively_parallel" title="Massively parallel">Massively parallel</a></li>
<li><a href="Cloud_computing" title="Cloud computing">Cloud computing</a></li>
<li><a href="High-performance_computing" title="High-performance computing">High-performance computing</a></li>
<li><a href="Multiprocessing" title="Multiprocessing">Multiprocessing</a></li>
<li><a href="Manycore_processor" title="Manycore processor">Manycore processor</a></li>
<li><a href="General-purpose_computing_on_graphics_processing_units" title="General-purpose computing on graphics processing units">GPGPU</a></li>
<li><a href="Computer_network" title="Computer network">Computer network</a></li>
<li><a href="Systolic_array" title="Systolic array">Systolic array</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Levels</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Bit-level_parallelism" title="Bit-level parallelism">Bit</a></li>
<li><a href="Instruction-level_parallelism" title="Instruction-level parallelism">Instruction</a></li>
<li><a href="Task_parallelism" title="Task parallelism">Thread</a></li>
<li><a href="Task_parallelism" title="Task parallelism">Task</a></li>
<li><a href="Data_parallelism" title="Data parallelism">Data</a></li>
<li><a href="Memory-level_parallelism" title="Memory-level parallelism">Memory</a></li>
<li><a href="Loop-level_parallelism" title="Loop-level parallelism">Loop</a></li>
<li><a href="Pipeline_(computing)" title="Pipeline (computing)">Pipeline</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Multithreading_(computer_architecture)" title="Multithreading (computer architecture)">Multithreading</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Temporal_multithreading" title="Temporal multithreading">Temporal</a></li>
<li><a href="Simultaneous_multithreading" title="Simultaneous multithreading">Simultaneous</a> (SMT)</li>
<li><a href="Simultaneous_and_heterogeneous_multithreading" title="Simultaneous and heterogeneous multithreading">Simultaneous and heterogenous</a></li>
<li><a href="Speculative_multithreading" title="Speculative multithreading">Speculative</a> (SpMT)</li>
<li><a href="Preemption_(computing)" title="Preemption (computing)">Preemptive</a></li>
<li><a href="Computer_multitasking#Cooperative_multitasking" title="Computer multitasking">Cooperative</a></li>
<li><a href="Bulldozer_(microarchitecture)#Bulldozer_core" title="Bulldozer (microarchitecture)">Clustered multi-thread</a> (CMT)</li>
<li><a href="Hardware_scout" title="Hardware scout">Hardware scout</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Theory</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Parallel_RAM" title="Parallel RAM">PRAM model</a></li>
<li><a href="Parallel_external_memory" title="Parallel external memory">PEM model</a></li>
<li><a href="Analysis_of_parallel_algorithms" title="Analysis of parallel algorithms">Analysis of parallel algorithms</a></li>
<li><a href="Amdahl's_law" title="Amdahl's law">Amdahl's law</a></li>
<li><a href="Gustafson's_law" title="Gustafson's law">Gustafson's law</a></li>
<li><a href="Cost_efficiency" title="Cost efficiency">Cost efficiency</a></li>
<li><a href="Karp%E2%80%93Flatt_metric" title="Karp–Flatt metric">Karp–Flatt metric</a></li>
<li><a href="Parallel_slowdown" title="Parallel slowdown">Slowdown</a></li>
<li><a href="Speedup" title="Speedup">Speedup</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Elements</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Process_(computing)" title="Process (computing)">Process</a></li>
<li><a href="Thread_(computing)" title="Thread (computing)">Thread</a></li>
<li><a href="Fiber_(computer_science)" title="Fiber (computer science)">Fiber</a></li>
<li><a href="Instruction_window" title="Instruction window">Instruction window</a></li>
<li><a href="Array_(data_structure)" title="Array (data structure)">Array</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Coordination</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Multiprocessing" title="Multiprocessing">Multiprocessing</a></li>
<li><a href="Memory_coherence" title="Memory coherence">Memory coherence</a></li>
<li><a href="Cache_coherence" title="Cache coherence">Cache coherence</a></li>
<li><a href="Cache_invalidation" title="Cache invalidation">Cache invalidation</a></li>
<li><a href="Barrier_(computer_science)" title="Barrier (computer science)">Barrier</a></li>

<li><a href="Application_checkpointing" title="Application checkpointing">Application checkpointing</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Computer_programming" title="Computer programming">Programming</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Stream_processing" title="Stream processing">Stream processing</a></li>
<li><a href="Dataflow_programming" title="Dataflow programming">Dataflow programming</a></li>
<li><a href="Parallel_programming_model" title="Parallel programming model">Models</a>
<ul><li><a href="Implicit_parallelism" title="Implicit parallelism">Implicit parallelism</a></li>
<li><a href="Explicit_parallelism" title="Explicit parallelism">Explicit parallelism</a></li>
<li><a href="Concurrency_(computer_science)" title="Concurrency (computer science)">Concurrency</a></li></ul></li>
<li><a href="Non-blocking_algorithm" title="Non-blocking algorithm">Non-blocking algorithm</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Computer_hardware" title="Computer hardware">Hardware</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Flynn's_taxonomy" title="Flynn's taxonomy">Flynn's taxonomy</a>
<ul><li><a href="Single_instruction%2C_single_data" title="Single instruction, single data">SISD</a></li>
<li><a href="Single_instruction%2C_multiple_data" title="Single instruction, multiple data">SIMD</a>
<ul><li><a href="Single_instruction%2C_multiple_threads" title="Single instruction, multiple threads">Array processing</a> (SIMT)</li>
<li><a href="Flynn's_taxonomy#Pipelined_processor" title="Flynn's taxonomy">Pipelined processing</a></li>
<li><a href="Flynn's_taxonomy#Associative_processor" title="Flynn's taxonomy">Associative processing</a></li></ul></li>
<li><a href="Multiple_instruction%2C_single_data" title="Multiple instruction, single data">MISD</a></li>
<li><a href="Multiple_instruction%2C_multiple_data" title="Multiple instruction, multiple data">MIMD</a></li></ul></li>
<li><a href="Dataflow_architecture" title="Dataflow architecture">Dataflow architecture</a></li>
<li><a href="Instruction_pipelining" title="Instruction pipelining">Pipelined processor</a></li>
<li><a href="Superscalar_processor" title="Superscalar processor">Superscalar processor</a></li>
<li><a href="Vector_processor" title="Vector processor">Vector processor</a></li>
<li><a href="Multiprocessing" title="Multiprocessing">Multiprocessor</a>
<ul><li><a href="Symmetric_multiprocessing" title="Symmetric multiprocessing">symmetric</a></li>
<li><a href="Asymmetric_multiprocessing" title="Asymmetric multiprocessing">asymmetric</a></li></ul></li>
<li><a href="Semiconductor_memory" title="Semiconductor memory">Memory</a>
<ul><li><a href="Shared_memory" title="Shared memory">shared</a></li>
<li><a href="Distributed_memory" title="Distributed memory">distributed</a></li>
<li><a href="Distributed_shared_memory" title="Distributed shared memory">distributed shared</a></li>
<li><a href="Uniform_memory_access" title="Uniform memory access">UMA</a></li>
<li><a href="Non-uniform_memory_access" title="Non-uniform memory access">NUMA</a></li>
<li><a href="Cache-only_memory_architecture" title="Cache-only memory architecture">COMA</a></li></ul></li>
<li><a href="Massively_parallel" title="Massively parallel">Massively parallel</a> computer</li>
<li><a href="Computer_cluster" title="Computer cluster">Computer cluster</a>
<ul><li><a href="Beowulf_cluster" title="Beowulf cluster">Beowulf cluster</a></li></ul></li>
<li><a href="Grid_computing" title="Grid computing">Grid computer</a></li>
<li><a href="Hardware_acceleration" title="Hardware acceleration">Hardware acceleration</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="API" title="API">APIs</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Ateji_PX" title="Ateji PX">Ateji PX</a></li>
<li><a href="Boost_(C%2B%2B_libraries)" title="Boost (C++ libraries)">Boost</a></li>
<li><a href="Chapel_(programming_language)" title="Chapel (programming language)">Chapel</a></li>
<li><a href="HPX" title="HPX">HPX</a></li>
<li><a href="Charm%2B%2B" title="Charm++">Charm++</a></li>
<li><a href="Cilk" title="Cilk">Cilk</a></li>
<li><a href="Coarray_Fortran" title="Coarray Fortran">Coarray Fortran</a></li>
<li><a href="CUDA" title="CUDA">CUDA</a></li>
<li><a href="Dryad_(programming)" title="Dryad (programming)">Dryad</a></li>
<li><a href="C%2B%2B_AMP" title="C++ AMP">C++ AMP</a></li>
<li><a href="Global_Arrays" title="Global Arrays">Global Arrays</a></li>
<li><a href="GPUOpen" title="GPUOpen">GPUOpen</a></li>
<li><a href="Message_Passing_Interface" title="Message Passing Interface">MPI</a></li>
<li><a href="OpenMP" title="OpenMP">OpenMP</a></li>
<li><a href="OpenCL" title="OpenCL">OpenCL</a></li>
<li><a href="OpenHMPP" title="OpenHMPP">OpenHMPP</a></li>
<li><a href="OpenACC" title="OpenACC">OpenACC</a></li>
<li><a href="Parallel_Extensions" title="Parallel Extensions">Parallel Extensions</a></li>
<li><a href="Parallel_Virtual_Machine" title="Parallel Virtual Machine">PVM</a></li>
<li><a href="Pthreads" title="Pthreads">pthreads</a></li>
<li><a href="RaftLib" title="RaftLib">RaftLib</a></li>
<li><a href="ROCm" title="ROCm">ROCm</a></li>
<li><a href="Unified_Parallel_C" title="Unified Parallel C">UPC</a></li>
<li><a href="Threading_Building_Blocks" title="Threading Building Blocks">TBB</a></li>
<li><a href="ZPL_(programming_language)" class="mw-redirect" title="ZPL (programming language)">ZPL</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Problems</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Automatic_parallelization" title="Automatic parallelization">Automatic parallelization</a></li>
<li><a href="Deadlock_(computer_science)" title="Deadlock (computer science)">Deadlock</a></li>
<li><a href="Deterministic_algorithm" title="Deterministic algorithm">Deterministic algorithm</a></li>
<li><a href="Embarrassingly_parallel" title="Embarrassingly parallel">Embarrassingly parallel</a></li>
<li><a href="Parallel_slowdown" title="Parallel slowdown">Parallel slowdown</a></li>
<li><a href="Race_condition" title="Race condition">Race condition</a></li>
<li><a href="Software_lockout" title="Software lockout">Software lockout</a></li>
<li><a href="Scalability" title="Scalability">Scalability</a></li>
<li><a href="Starvation_(computer_science)" title="Starvation (computer science)">Starvation</a></li></ul>
</div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div>
<ul><li><span class="noviewer" typeof="mw:File"><span title="Category"></span></span>&nbsp;Category: Parallel computing</li></ul>
</div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-08-07" href="https://en.wikipedia.org/wiki/?title=Synchronization_(computer_science)&amp;oldid=1304663678">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>